package com.lzq.springblog.service;

import com.lzq.springblog.dao.LikeInfoMapper;
import com.lzq.springblog.model.LikeInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LikeService {

    @Autowired
    private LikeInfoMapper likeInfoMapper;

    public Boolean isliked(Integer userId, Integer blogId) {
        LikeInfo likeInfo = likeInfoMapper.selectIsLiked(userId,blogId);
        if(likeInfo==null || likeInfo.getDeleteFlag()==0) {
            return false;
        }else {
            return true;
        }

    }
}
